function submitCreate() {
	var name = $.trim($("#name").val());
	var pwd = $.trim($("#pwd").val());
	var email = $.trim($("#email").val());
	var from = $.trim($("#from").val());
	var type = $.trim($("#type").val());
	var level = $.trim($("#level").val());
	var status = $('input:radio[name="status"]:checked').val();
	var contactName = $.trim($("#contactName").val());
	var contactTel = $.trim($("#contactTel").val());
	var contactOthers = $.trim($("#contactOthers").val());
	var companyName = $.trim($("#companyName").val());
	var companyZip = $.trim($("#companyZip").val());
	var companyAddress = $.trim($("#companyAddress").val());
	var companyTel = $.trim($("#companyTel").val());
	var companyFax = $.trim($("#companyFax").val());
	var companyEmail = $.trim($("#companyEmail").val());
	var companyWebsite = $.trim($("#companyWebsite").val());
	var companyReg = $.trim($("#companyReg").val());
	var chargeName = $.trim($("#chargeName").val());
	var extfrom = $('input:radio[name="extfrom"]:checked').val();
	$.ajax({
		type : 'POST',
		url : "/customer/add.json",
		dataType : "json",
		data : {
			name : name,
			pwd : pwd,
			email : email,
			from : from,
			type : type,
			level : level,
			status : status,
			contactName : contactName,
			contactTel : contactTel,
			contactOthers : contactOthers,
			companyName : companyName,
			companyZip : companyZip,
			companyAddress : companyAddress,
			companyTel : companyTel,
			companyFax : companyFax,
			companyEmail : companyEmail,
			companyWebsite : companyWebsite,
			companyReg : companyReg,
			chargeName : chargeName,
			extfrom : extfrom
		},
		success : function(data) {
			if (data && data.ok) {
				alert("添加成功！");
				window.location.reload();
			} else {
				alert(data.msg);
			}
		},
		error : function(error) {
			alert("添加失败！");
		}
	});
}

function submitModify(id) {
	var pwd = $.trim($("#pwd").val());
	var email = $.trim($("#email").val());
	var from = $.trim($("#from").val());
	var type = $.trim($("#type").val());
	var level = $.trim($("#level").val());
	var status = $('input:radio[name="status"]:checked').val();
	var contactName = $.trim($("#contactName").val());
	var contactTel = $.trim($("#contactTel").val());
	var contactOthers = $.trim($("#contactOthers").val());
	var companyName = $.trim($("#companyName").val());
	var companyZip = $.trim($("#companyZip").val());
	var companyAddress = $.trim($("#companyAddress").val());
	var companyTel = $.trim($("#companyTel").val());
	var companyFax = $.trim($("#companyFax").val());
	var companyEmail = $.trim($("#companyEmail").val());
	var companyWebsite = $.trim($("#companyWebsite").val());
	var companyReg = $.trim($("#companyReg").val());
	var chargeName = $.trim($("#chargeName").val());
	var extfrom = $('input:radio[name="extfrom"]:checked').val();
	$.ajax({
		type : 'POST',
		url : "/customer/modify.json",
		dataType : "json",
		data : {
			id : id,
			pwd : pwd,
			email : email,
			from : from,
			type : type,
			level : level,
			status : status,
			contactName : contactName,
			contactTel : contactTel,
			contactOthers : contactOthers,
			companyName : companyName,
			companyZip : companyZip,
			companyAddress : companyAddress,
			companyTel : companyTel,
			companyFax : companyFax,
			companyEmail : companyEmail,
			companyWebsite : companyWebsite,
			companyReg : companyReg,
			chargeName : chargeName,
			extfrom : extfrom
		},
		success : function(data) {
			if (data && data.ok)
				alert("修改成功！");
			else {
				alert(data.msg);
			}
		},
		error : function(error) {
			alert("修改失败！");
		}
	});
}